<template>
	<view class="mainCss">
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>合伙订单</text>
			</view>
			<view class="titleRight">
				
			</view>
		</view>
		<view class="typeBox">
			<view class="type" :class="[type == index ? 'type1' : 'type']" v-for="(item, index) in typeList"
				:key="index" @click="tapInfo(index)">
				<text>{{item.typeName}}</text>
			</view>
		</view>
		<view class="bodyBox">
			<view class="">
				<view class="orderBox" v-for="(item, index) in orderList" :key="index">
					<view class="">
						<img :src="item.imgUrl" class="img">
					</view>
					<view class="nameBox">
						<view class="">
							<text>{{ item.name }}</text>
						</view>
						<view class="invest">
							<text>投资{{ item.invest }}万元</text>
						</view>
					</view>
					<view class="rightBox">
						<view class="">
							<text class="payfor" v-if="item.state == 1">待支付</text>
							<text class="finish" v-if="item.state == 2">已完成</text>
							<view class="time" v-if="item.state == 1">
								<text>00:05:20</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="block">
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 0,
				typeList: [{
					typeName: '全部'
				}, {
					typeName: '待支付'
				}, {
					typeName: '已完成'
				}],
				orderList: [{
					imgUrl: '../../static/home/info.jpg',
					name: '明清街1-20号',
					time: '',
					state: 1,
					invest: 2,
				}, {
					imgUrl: '../../static/home/info.jpg',
					name: '明清街1-20号',
					time: '',
					state: 2,
					invest: 2,
				}]
			}
		},
		onLoad() {
			for (let i = 0; i < this.orderList.length; i++) {
				this.orderList[i].money = parseFloat(this.orderList[i].money).toFixed(2)
			}
		},
		methods: {
			// 返回
			goBack() {
				uni.navigateBack(0)
			},
			// 获取当前选择
			tapInfo(index) {
				this.type = index
			}
		}
	}
</script>

<style>
	@import '../../css/shipOrder.css';
</style>